import request from '@/sheep/request';

const GroupApi = {
  // 查询分组联系人列表
  queryContactByGroup: (data) => {
    return request({
      url: '/relation/group/queryContactByGroup',
      method: 'POST',
      data,
      custom: {
        auth: true
      },
    });
  },
  // 查询分组列表
  queryGroupList: (data) => {
    return request({
      url: '/relation/group/queryGroupList',
      method: 'POST',
      data,
      custom: {
        auth: true
      },
    });
  },
  // 添加用户分组
  addOrUpdateContactGroup: (data) => {
    return request({
      url: '/relation/group/addOrUpdateContactGroup',
      method: 'POST',
      data,
      custom: {
        auth: true,
        successMsg: '设置成功'
      },
    });
  },
  // 批量添加联系人到分组
  batchAddGroupContacts: (data) => {
    return request({
      url: '/relation/group/batchAddGroupContacts',
      method: 'POST',
      data,
      custom: {
        auth: true,
        successMsg: '添加成功'
      },
    });
  },
  // 批量删除联系人到分组
  batchDelGroupContacts: (data) => {
    return request({
      url: '/relation/group/batchDelGroupContacts',
      method: 'POST',
      data,
      custom: {
        auth: true,
        successMsg: '删除成功'
      },
    });
  },

  // 删除群组
  delContactGroup: (data) => {
    return request({
      url: '/relation/group/delContactGroup',
      method: 'POST',
      data,
      custom: {
        auth: true,
        successMsg: '删除成功'
      },
    });
  },

};

export default GroupApi;
